package top.loonglove.newindexserver.entity;

import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.core.GrantedAuthority;
import top.loonglove.common.base.entity.BaseEntity;
import top.loonglove.common.util.http.HttpMethod;
import top.loonglove.newindexserver.util.Status;

/**
 * @author : xgl
 * @version : 0.0.1
 * @date :2021/7/26 23:02
 */
public class Permission extends BaseEntity implements GrantedAuthority {
    /**
     * If the <code>GrantedAuthority</code> can be represented as a <code>String</code>
     * and that <code>String</code> is sufficient in precision to be relied upon for an
     * access control decision by an {@link AccessDecisionManager} (or delegate), this
     * method should return such a <code>String</code>.
     * <p>
     * If the <code>GrantedAuthority</code> cannot be expressed with sufficient precision
     * as a <code>String</code>, <code>null</code> should be returned. Returning
     * <code>null</code> will require an <code>AccessDecisionManager</code> (or delegate)
     * to specifically support the <code>GrantedAuthority</code> implementation, so
     * returning <code>null</code> should be avoided unless actually required.
     *
     * @return a representation of the granted authority (or <code>null</code> if the
     * granted authority cannot be expressed as a <code>String</code> with sufficient
     * precision).
     */
    @Override
    public String getAuthority() {
        return null;
    }

    private String permissionName;

    private String permissionDescription;

    private String permissionCode;

    private HttpMethod httpMethod;

    private Status status;
}
